package awk.designModel.adapter.object;


import awk.designModel.adapter.Adapter;
import awk.designModel.adapter.MyTarget;

/**
 * 持有 adapter 对象适配器类,从而复用了Adapter的方法
 */
public class ObjectAdapter implements MyTarget {

	private Adapter adapter;

	public ObjectAdapter(Adapter adapter) {
		this.adapter = adapter;
	}

	public void request() {
		adapter.specificRequest();
	}

	public static void main(String[] args) {
		System.out.println("对象适配器模式测试：");
		Adapter adapter = new Adapter();
		MyTarget target = new ObjectAdapter(adapter);
		target.request();
	}
}
